<template>
	<view class="container-app">
		<uni-card class="order-box">
			<view class="order_num">
				<view>订单号：</view>
				<view>{{orderInfo.id}}</view>
			</view>
			<view class="order-collectionTime">
				<view>缴费时间：</view>
				<view>{{orderInfo.collectionTime}}</view>
			</view>
			<view class="order-roomNum">
				<view>房间号：</view>
				<view>{{orderInfo.roomNum}}</view>
			</view>
			<view class="order-status">
				<view>当前状态：</view>
				<view>{{orderInfo.status}}</view>
			</view>
			<view class="order-rent">
				<view>租金：</view>
				<view>{{orderInfo.rent}}￥</view>
			</view>
			<view class="order-overdueDay" v-if="orderInfo.overdueDay != 0">
				<view>逾期天数：</view>
				<view>{{orderInfo.overdueDay}}天</view>
			</view>
			<view class="order-overdueAmount" v-if="orderInfo.overdueAmount != 0">
				<view>逾期金额：</view>
				<view>{{orderInfo.overdueAmount}}￥</view>
			</view>
			<view class="order-total">
				<view>总计：</view>
				<view>{{orderInfo.totalAmount}}￥</view>
			</view>
			<button type="primary" size="default">立即支付</button>
		</uni-card>
		
	</view>
</template>

<script>
	import {getRillInfo} from '@/api/bill/bill.js'
	
	export default {
		data() {
			return {
				id: '',
				orderInfo:'',
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.loadBill(option.id);
		},
		
		methods: {
			loadBill(id) {
				getRillInfo(id).then(res =>{
					this.orderInfo = res.data;
				}) 
			},
			
		}
	}
</script>

<style scoped lang="scss">
	
	.container-app{
		width: 100%;
		height: 100%;
	}
	
	.order-box{
		height: 85vh;
	}
	
	.order_num {
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-collectionTime{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-roomNum{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-status{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-rent{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-overdueDay{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-overdueAmount{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.order-total{
		margin: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
</style>